<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Aestate: aestate.work.Annotation Namespace Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Aestate
   &#160;<span id="projectnumber">1.0.5</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceaestate.html">aestate</a></li><li class="navelem"><a class="el" href="namespaceaestate_1_1work.html">work</a></li><li class="navelem"><a class="el" href="namespaceaestate_1_1work_1_1_annotation.html">Annotation</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">aestate.work.Annotation Namespace Reference</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a0c2a2efda9eb54562253e840bb5d0f49"><td class="memItemLeft" align="right" valign="top">def&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceaestate_1_1work_1_1_annotation.html#a0c2a2efda9eb54562253e840bb5d0f49">Table</a> (name, msg, **kwargs)</td></tr>
<tr class="separator:a0c2a2efda9eb54562253e840bb5d0f49"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac08818b3674c675825f79597c16a79dd"><td class="memItemLeft" align="right" valign="top">def&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceaestate_1_1work_1_1_annotation.html#ac08818b3674c675825f79597c16a79dd">Select</a> (str sql)</td></tr>
<tr class="separator:ac08818b3674c675825f79597c16a79dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aff598086972f97be72f7422f46108015"><td class="memItemLeft" align="right" valign="top">def&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceaestate_1_1work_1_1_annotation.html#aff598086972f97be72f7422f46108015">SelectAbst</a> ()</td></tr>
<tr class="separator:aff598086972f97be72f7422f46108015"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a53f3face99e699b9b9d5ea7a3d87e20d"><td class="memItemLeft" align="right" valign="top">def&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceaestate_1_1work_1_1_annotation.html#a53f3face99e699b9b9d5ea7a3d87e20d">AopModel</a> (before=None, after=None, before_args=None, before_kwargs=None, after_args=None, after_kwargs=None)</td></tr>
<tr class="separator:a53f3face99e699b9b9d5ea7a3d87e20d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac32df9034e26df39f1e2e10d6a8015ec"><td class="memItemLeft" align="right" valign="top">def&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceaestate_1_1work_1_1_annotation.html#ac32df9034e26df39f1e2e10d6a8015ec">ReadXml</a> (filename)</td></tr>
<tr class="separator:ac32df9034e26df39f1e2e10d6a8015ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af37f23c3d8f2634cdabba89f0edae5b0"><td class="memItemLeft" align="right" valign="top">def&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceaestate_1_1work_1_1_annotation.html#af37f23c3d8f2634cdabba89f0edae5b0">Item</a> (id, d=False)</td></tr>
<tr class="separator:af37f23c3d8f2634cdabba89f0edae5b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a68f94790377d607daa1998abfe5ead4b"><td class="memItemLeft" align="right" valign="top">def&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceaestate_1_1work_1_1_annotation.html#a68f94790377d607daa1998abfe5ead4b">Objects</a> ()</td></tr>
<tr class="separator:a68f94790377d607daa1998abfe5ead4b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="a53f3face99e699b9b9d5ea7a3d87e20d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a53f3face99e699b9b9d5ea7a3d87e20d">&#9670;&nbsp;</a></span>AopModel()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">def aestate.work.Annotation.AopModel </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>before</em> = <code>None</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>after</em> = <code>None</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>before_args</em> = <code>None</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>before_kwargs</em> = <code>None</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>after_args</em> = <code>None</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>after_kwargs</em> = <code>None</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<pre class="fragment">    AOP切面模式：
        依赖AopModel装饰器,再在方法上加入@AopModel即可切入编程


    优点:

        当使用@AopModel时,内部函数将会逐级调用回调函数,执行循序是:
            - func(*self.args, **self.kwargs)
            - func(*self.args)
            - func(**self.kwargs)
            - func()
        这将意味着,如果你的参数传入错误时,AopModel依旧会遵循原始方法所使用的规则,最令人大跌眼镜的使用方法就是:
&lt;code&gt;
            def Before(**kwargs):
                print('Before:', kwargs)
            # 此处的Before方法未存在args参数,而使用@AopModel时却传入了args
            @AopModel(before=Before,before_args=(0,1,2), before_kwargs={'1': '1'})
            def find_title_and_selects(self, **kwargs):

                print('function task', kwargs['uid'])

                _r = self.orm.find().where(index="&lt;&lt;100").end()

                print(_r)

                return _r
&lt;/code&gt;
        其中包含参数有:
            before:切入时需要执行的函数

            before_args:切入的参数
                传入的列表或元组类型数据
                如果是需要使用当前pojo中的内容时，传参格式为:(pojo.字段名)
                可扩展格式，例如需要传入字典

            before_kwargs:切入的参数 -- 传入的字典数据

            after:切出前需要执行的参数

            after_args:切出的参数
                传入的列表或元组类型数据
                如果是需要使用当前pojo中的内容时，传参格式为:('self.字段名')
                可扩展格式，例如需要传入字典:('self.dict.key')

            after_kwargs:切出的参数 -- 传入的字典数据


    执行流程:

        Before-&gt;original-&gt;After

    Before注意事项:

        使用该参数时，方法具有返回值概不做处理,需要返回值内容可使用`global`定义一个全局字段用于保存数值

        当无法解析或者解析失败时m将使用pass关键字忽略操作

    After注意事项:

        使用该参数时，必须搭配至少一个result=None的kwargs存在于方法的形参中,

        当original方法执行完成将把返回值固定使用result键值对注入到该函数中

        当无法解析或者解析失败时m将使用pass关键字忽略操作



    Attributes:

         before:切入时需要执行的函数

         after:切出前需要执行的参数

         before_args:切入的参数
            传入的列表或元组类型数据
            如果是需要使用当前pojo中的内容时，传参格式为:(pojo.字段名)
            可扩展格式，例如需要传入字典

         before_kwargs:切入的参数 -- 传入的字典数据

         after_args:切出的参数
            传入的列表或元组类型数据
            如果是需要使用当前pojo中的内容时，传参格式为:('self.字段名')
            可扩展格式，例如需要传入字典:('self.dict.key')

         after_kwargs:切出的参数 -- 传入的字典数据</pre> 
<p class="definition">Definition at line <a class="el" href="work_2annotation_8py_source.html#l00106">106</a> of file <a class="el" href="work_2annotation_8py_source.html">Annotation.py</a>.</p>

</div>
</div>
<a id="af37f23c3d8f2634cdabba89f0edae5b0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af37f23c3d8f2634cdabba89f0edae5b0">&#9670;&nbsp;</a></span>Item()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">def aestate.work.Annotation.Item </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>d</em> = <code>False</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<pre class="fragment">将xml的item节点映射到当前方法,对应的id字段为xml节点的id
</pre> 
<p class="definition">Definition at line <a class="el" href="work_2annotation_8py_source.html#l00236">236</a> of file <a class="el" href="work_2annotation_8py_source.html">Annotation.py</a>.</p>

</div>
</div>
<a id="a68f94790377d607daa1998abfe5ead4b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a68f94790377d607daa1998abfe5ead4b">&#9670;&nbsp;</a></span>Objects()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">def aestate.work.Annotation.Objects </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<pre class="fragment">注入一个objects,可以不用new
</pre> 
<p class="definition">Definition at line <a class="el" href="work_2annotation_8py_source.html#l00293">293</a> of file <a class="el" href="work_2annotation_8py_source.html">Annotation.py</a>.</p>

</div>
</div>
<a id="ac32df9034e26df39f1e2e10d6a8015ec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac32df9034e26df39f1e2e10d6a8015ec">&#9670;&nbsp;</a></span>ReadXml()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">def aestate.work.Annotation.ReadXml </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>filename</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<pre class="fragment">读取xml</pre> 
<p class="definition">Definition at line <a class="el" href="work_2annotation_8py_source.html#l00217">217</a> of file <a class="el" href="work_2annotation_8py_source.html">Annotation.py</a>.</p>

</div>
</div>
<a id="ac08818b3674c675825f79597c16a79dd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac08818b3674c675825f79597c16a79dd">&#9670;&nbsp;</a></span>Select()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">def aestate.work.Annotation.Select </td>
          <td>(</td>
          <td class="paramtype">str&#160;</td>
          <td class="paramname"><em>sql</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<pre class="fragment">快捷的查询装饰器

使用此装饰器,可以将大量重复代码继承到此装饰器内部实现

使用方法:
    @Select(sql="SELECT * FROM demo_table WHERE t_id&lt;=%s AND t_msg like %s", params=['${t_id}', '%${t_msg}%'])

    sql:执行的sql语句,需要加密的参数使用`%s`表示

    params:加密参数的内容,标记使用传参请使用`${字段名}`表示</pre> 
<p class="definition">Definition at line <a class="el" href="work_2annotation_8py_source.html#l00032">32</a> of file <a class="el" href="work_2annotation_8py_source.html">Annotation.py</a>.</p>

</div>
</div>
<a id="aff598086972f97be72f7422f46108015"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aff598086972f97be72f7422f46108015">&#9670;&nbsp;</a></span>SelectAbst()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">def aestate.work.Annotation.SelectAbst </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="work_2annotation_8py_source.html#l00065">65</a> of file <a class="el" href="work_2annotation_8py_source.html">Annotation.py</a>.</p>

</div>
</div>
<a id="a0c2a2efda9eb54562253e840bb5d0f49"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0c2a2efda9eb54562253e840bb5d0f49">&#9670;&nbsp;</a></span>Table()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">def aestate.work.Annotation.Table </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">**&#160;</td>
          <td class="paramname"><em>kwargs</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<pre class="fragment">标注该类为一个表
:param name:表的名称
:param msg:表的描述
:return:
</pre> 
<p class="definition">Definition at line <a class="el" href="work_2annotation_8py_source.html#l00014">14</a> of file <a class="el" href="work_2annotation_8py_source.html">Annotation.py</a>.</p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
